#include "FastMoveDockWidget.h"
#include <QVBoxLayout>

FastMoveDockWidget::FastMoveDockWidget(QWidget *parent, Qt::WindowFlags flags)
    :QDockWidget(parent, flags)
{
    initContent();
    initConnection();
    setAllowedAreas( Qt::RightDockWidgetArea );
    //setFeatures(QDockWidget::DockWidgetVerticalTitleBar);
    setWindowTitle("Fast Move Dialog");
}

void FastMoveDockWidget::initContent()
{
    QWidget * dockWidget = new QWidget;

    widget = new FastMoveWidget();

    QVBoxLayout * layout = new QVBoxLayout(dockWidget);
    layout->addWidget(widget);
    layout->addStretch();
    setWidget(dockWidget);
    //widget->show();
}

void FastMoveDockWidget::initConnection()
{
    connect(widget, SIGNAL(gotoPos(double,double)), this, SIGNAL(gotoPos(double,double)));
    connect(widget, SIGNAL(fetchPos(int)), this, SIGNAL(fetchPos(int)));
}

void FastMoveDockWidget::setPos(int i, double x, double y)
{
    widget->setPos(i, x, y);
}
